package edu.luc.concordia;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 * Copyright 2008 Project Concordia
 * <p>
 * This file is part of RetailReturnSystem.
 * <p>
 * RetailReturnSystem is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <p>
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * <p>
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
 * <hr>
 * 
 * @author Rashmi Pandey 
 * @version 2.0 NOV-21-2008
 *  
 * This method creates System Price Scheme GUI for the retail return system.
 */


public class SystemPriceScheme extends JPanel implements ActionListener{
	
	private javax.swing.JButton doneButton;
    private javax.swing.JButton addButton;
    private javax.swing.JButton updateButton;
    private javax.swing.JButton backButton;
    private javax.swing.JComboBox priceSchemeComboBox;
    private javax.swing.JLabel priceIdLabel;
    private javax.swing.JLabel descLabel;
    private javax.swing.JLabel priceLabel;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea priceTextArea;
    private javax.swing.JTextField priceTextField;
    private JFrame frame;
    
    /** This method is called from within the constructor to
     * initialize the form.
     */
    private SystemPriceScheme(JFrame frame) {
    	this.frame = frame;
 		this.setLayout(new BorderLayout());
 		JPanel displayPanel = new JPanel();
 		displayPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
 		
 		priceIdLabel = new javax.swing.JLabel();
        priceTextField = new javax.swing.JTextField();
        doneButton = new javax.swing.JButton();
        descLabel = new javax.swing.JLabel();
        priceSchemeComboBox = new javax.swing.JComboBox();
        priceLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        priceTextArea = new javax.swing.JTextArea();
        addButton = new javax.swing.JButton();
        updateButton = new javax.swing.JButton();
        backButton = new javax.swing.JButton();
        setText(DateUtils.now() + "\n----------------------------------- \n" + 
		"\n\n\n THANK YOU !");

        priceIdLabel.setText("Price Scheme ID : ");
        doneButton.setText("Done");
        descLabel.setText("Description : ");
        priceSchemeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Product Price Scheme", "Category Price Scheme", "System Price Scheme"}));
        priceLabel.setText("Price Scheme : ");
        priceTextArea.setColumns(20);
        priceTextArea.setRows(15);
        jScrollPane1.setViewportView(priceTextArea);
        addButton.setText("Add");
        updateButton.setText("Update");
        backButton.setText("Back");
        
        /**
         * Set all the buttons, TextArea in the Layout.
         */ 
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(priceIdLabel)
                            .addComponent(descLabel)
                            .addComponent(priceLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(priceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(26, 26, 26)
                                .addComponent(doneButton))
                            .addComponent(priceSchemeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(75, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(addButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE)
                        .addComponent(updateButton)
                        .addGap(72, 72, 72)
                        .addComponent(backButton)
                        .addGap(53, 53, 53))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(priceIdLabel)
                    .addComponent(priceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(doneButton))
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(descLabel)
                    .addComponent(priceSchemeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(41, 41, 41)
                        .addComponent(priceLabel))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(31, 31, 31)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(updateButton)
                    .addComponent(addButton)
                    .addComponent(backButton))
                .addContainerGap())
        );
    }   
    
    /**
     * Set the return text area to have the string.
     * @param str
     */
   public void setText(String str)
	{ 		
	   priceTextArea.setText(str);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
	}
        
}
